---
id: 661483051820c3c1ab4595e0
title: Step 87
challengeType: 1
dashedName: step-87
---

# --description--

You can also replace the `done` reference in your `padRow` call.

Note that `rows.length` here would give you an off-by-one error, because `done` is incremented *before* the call.

So you'll need to replace `done` here with `rows.length + 1`. When you do this, you may see a `Range Error`, because we've created another off-by-one error.

You'll need to change the `while` condition to use the less than operator, instead of the less than or equal operator.

# --hints--

You should pass `rows.length + 1` as the first argument to your `padRow` call.

```js
assert.match(code, /rows\.push\(padRow\s*\(\s*rows\.length\s*\+\s*1/);
```

Your `while` loop should run while `rows.length` is less than `count`.

```js
assert.match(code, /while\s*\(\s*rows\.length\s*<\s*count\)/);
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
  rows.push(padRow(i, count));
}*/

--fcc-editable-region--
let done = 0;

while (rows.length <= count) {
  done++;
  rows.push(padRow(done, count));
}
--fcc-editable-region--

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
